
//
//  lyricsItem.swift
//  QQMusic
//
//  Created by xmg on 16/9/7.
//  Copyright © 2016年 wlis. All rights reserved.
//

import UIKit

class lyricsItem: NSObject {

    var lrcTime : NSTimeInterval = 0
    var lrcText : String = ""
    
    init(lrcStr : String) {
        lrcText = lrcStr.componentsSeparatedByString("]").last ?? ""
        
        let lrcTimeStr = lrcStr.componentsSeparatedByString("]").first?.componentsSeparatedByString("[").last ?? ""
        let min = Int(lrcTimeStr.componentsSeparatedByString(":").first ?? "") ?? 0
        let second = Int(lrcTimeStr.componentsSeparatedByString(":").last?.componentsSeparatedByString(".").first ?? "") ?? 0
        let haomiao = Int(lrcTimeStr.componentsSeparatedByString(":").last?.componentsSeparatedByString(".").last ?? "") ?? 0
        lrcTime = Double(min * 60 + second) + Double(haomiao) * 0.01
    }
}
